<?php

use Tx\Mailer;
use Tx\Mailer\SMTP;
use Tx\Mailer\Message;
use Tx\Mailer\Exceptions\SMTPException;

require_once './src/Mailer.php';
require_once './src/Mailer/SMTP.php';
require_once './src/Mailer/Message.php';
require_once './src/Mailer/Exceptions/SMTPException.php';

$to = $_GET['to'];
$code = $_GET['code'];
$msg = "verification code : <b>$code</b><br><br>
 ----------------------------------------------------<br><br>
 The code runs for 10 minutes.<br>
 If this message is in a spam box, please click on it and it is not spam.";

$result = (new Mailer())
    ->setServer('smtp.exmail.qq.com', 465)
    ->setAuth('guozhenxuan@doctorcom.com', 'Gzx.2022')
    ->setFrom('Iplook AAA', 'guozhenxuan@doctorcom.com')
    ->addTo('DRCOM', $to)
    ->setSubject('Login Auth Code')
    ->setBody($msg)
    ->send();

echo $result;
